import java.util.Scanner;

public class Preclass02 {
    public static int isOddsum(int number){
        int sum = 0;
        for (int i = 1; i <=number ; i++) {
            int count = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0){
                    count++;
                }
                if (count > 2){
                    continue;
                }
            }
            if (count == 2) {
                System.out.print(i + "\t");
                sum += i;
            }
            if (count > 2){
                continue;
            }
        }
        System.out.println();
        System.out.print("质数的和为：");
        return sum;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数");
        int number  = sc.nextInt();
        System.out.println(isOddsum(number));
    }

}
